package com.wyw.log.learning.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Title
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * @Date 2024/3/28 18:11
 * Update History:
 * Author        Time            Content
 */
@Service
@Slf4j
public class TestService {

    @Async("getAsyncExecutor")//使用自定义线程池
    public void asyncImportGoods(String taskId) {
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        log.info("async task running taskId: {}", taskId);

    }
}
